﻿using System;
using UnityEngine;

// Token: 0x0200028E RID: 654
public class PlaySystemSE : MonoBehaviour
{
	// Token: 0x060010E0 RID: 4320 RVA: 0x0006B0E4 File Offset: 0x000692E4
	private void Start()
	{
		if (this.gameCtrl == null)
		{
			this.Setup();
		}
	}

	// Token: 0x060010E1 RID: 4321 RVA: 0x0006B100 File Offset: 0x00069300
	private void Setup()
	{
		this.gameCtrl = UnityEngine.Object.FindObjectOfType<GameControl>();
		switch (this.type)
		{
		case PlaySystemSE.SE.CHOICE:
			this.clip = this.gameCtrl.audioCtrl.systemSE_choice;
			break;
		case PlaySystemSE.SE.YES:
			this.clip = this.gameCtrl.audioCtrl.systemSE_yes;
			break;
		case PlaySystemSE.SE.NO:
			this.clip = this.gameCtrl.audioCtrl.systemSE_no;
			break;
		case PlaySystemSE.SE.OPEN:
			this.clip = this.gameCtrl.audioCtrl.systemSE_open;
			break;
		case PlaySystemSE.SE.CLOSE:
			this.clip = this.gameCtrl.audioCtrl.systemSE_close;
			break;
		}
	}

	// Token: 0x060010E2 RID: 4322 RVA: 0x0006B1C8 File Offset: 0x000693C8
	public void Play()
	{
		if (this.gameCtrl == null)
		{
			this.Setup();
		}
		this.gameCtrl.audioCtrl.Play2DSE(this.clip);
	}

	// Token: 0x060010E3 RID: 4323 RVA: 0x0006B1F8 File Offset: 0x000693F8
	public void Play(bool flag)
	{
		if (!flag)
		{
			return;
		}
		if (this.gameCtrl == null)
		{
			this.Setup();
		}
		this.gameCtrl.audioCtrl.Play2DSE(this.clip);
	}

	// Token: 0x040011F5 RID: 4597
	private GameControl gameCtrl;

	// Token: 0x040011F6 RID: 4598
	private AudioClip clip;

	// Token: 0x040011F7 RID: 4599
	[SerializeField]
	private PlaySystemSE.SE type;

	// Token: 0x0200028F RID: 655
	public enum SE
	{
		// Token: 0x040011F9 RID: 4601
		CHOICE,
		// Token: 0x040011FA RID: 4602
		YES,
		// Token: 0x040011FB RID: 4603
		NO,
		// Token: 0x040011FC RID: 4604
		OPEN,
		// Token: 0x040011FD RID: 4605
		CLOSE,
		// Token: 0x040011FE RID: 4606
		NUM
	}
}
